package com.wwl.springcloud.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/8/9 17:59
 * @description:
 */
@Api(value = "/consul",description = "consul测试", tags = {"consul"})
@RestController
public class OrderConsulController {
    public static final String INVOME_URL = "http://consul-provider-payment";
    @Resource
    private RestTemplate restTemplate;
    @ApiOperation("检测consul注册是否成功")
    @PostMapping("/consumer/payment/consul")
    public String payment() {
        return restTemplate.postForObject(INVOME_URL + "/consul", null, String.class);
    }

}
